package com.kcwx.common;

import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import net.sf.json.util.JavaIdentifierTransformer;
 
public class TestUtils {
    public static void main(String[] args) {
        String tString = "{\"FuncName\":\"UploadGroupInfo\",\"ParamNum\":\"1\",\"ParamValue\":\"444\"}";
        JSONObject jsonObj1 = JSONObject.fromObject(tString);
        JsonConfig config = new JsonConfig();
        config.setJavaIdentifierTransformer(new JavaIdentifierTransformer() {
 
            @Override
            public String transformToJavaIdentifier(String str) {
                char[] chars = str.toCharArray();
                chars[0] = Character.toLowerCase(chars[0]);
                return new String(chars);
            }
 
        });
//        config.setRootClass(DrugMedicineOutput.class);
//        DrugMedicineOutput p2 = (DrugMedicineOutput) JSONObject.toBean(jsonObj1, config);
//        System.out.println("json转化为对象：方法名：" + p2.getFuncName() + ";数量:" + p2.getParamNum() + "值：" + p2.getParamValue());
    }
}